package cn.tedu.service.impl;

import cn.tedu.dao.UserDao;
import cn.tedu.domain.SysUser;
import cn.tedu.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("UserServiceImpl")
public class UserServiceImpl implements UserService {
    /*@Autowired
    @Qualifier("OracleDao")*/
    @Resource(name = "MysqlDao")
    private UserDao dao=null;

    //是用带参构造set赋值，需要创建对应的set方法
//    public void setDao(UserDao dao) {
//        System.out.println("调用了UserServiceImpl中的setDao方法");
//        this.dao = dao;
//    }

    @Override
    public void addUser(SysUser user) {
        //调用dao的方法
        dao.insertUser(user);
    }
}
